//
//  QuestionaireHeader.m
//  PigMarket
//
//  Created by 张敬 on 2019/8/13.
//  Copyright © 2019年 pigmarket.oc. All rights reserved.
//

#import "QuestionaireHeader.h"

@interface QuestionaireHeader()

@property (nonatomic, strong) UIImageView *logo;
@property (nonatomic, strong) UIImageView *welcomeIogo;
@property (nonatomic, strong) UILabel *titleLab;
@property (nonatomic, strong) UILabel *detailLab;




@end


@implementation QuestionaireHeader

#pragma mark - lifecycle methods
- (void)setupUI
{
    UIImage *image = [UIImage imageNamed:@"meat_questionnaire"];
    self.layer.contents =  (__bridge id)image.CGImage;
    
    [self addSubview:self.logo];
    [self addSubview:self.welcomeIogo];
    [self addSubview:self.titleLab];
    [self addSubview:self.detailLab];
}


- (void)setupLayout
{
    self.height = 200;
    
    {
        _logo.size = CGSizeMake(52, 52);
        _logo.mj_x = 15;
        _logo.mj_y = 15;
    }
    
    {
        _welcomeIogo.size = CGSizeMake(124, 25);
        _welcomeIogo.mj_y = 30;
        _welcomeIogo.mj_x = _logo.right + 15;
    }
    
    {
        _titleLab.size = CGSizeMake(KScreenWidth - 30, 22);
        _titleLab.mj_x = 15;
        _titleLab.mj_y = _logo.bottom +10;
    }
    
    {
        _detailLab.size = CGSizeMake(KScreenWidth - 30, 77);
        _detailLab.mj_y = _logo.bottom + 41;
        _detailLab.mj_x = 15;
    }
}

#pragma mark - setter methods
#pragma mark - getter methods

- (UIImageView *)logo{
    
    if (!_logo) {
        _logo = [UIImageView makeImageByImageName:@"meat_logo" cornerRadius:0];
    }
    return _logo;
}


- (UIImageView *)welcomeIogo{
    
    if (!_welcomeIogo) {
        _welcomeIogo = [UIImageView makeImageByImageName:@"meat_question_tip" cornerRadius:0];
    }
    return _welcomeIogo;
}


- (UILabel *)titleLab{
    
    if (!_titleLab) {
        _titleLab = [UILabel makeLabelWithText:@"豚集APP满意度问卷调查" textColor:mMainColor font:mMediumFont(18) textAliment:0];
    }
    return _titleLab;
}


- (UILabel *)detailLab{
    
    if (!_detailLab) {
        _detailLab = [UILabel makeLabelWithText:@"欢迎参加本次答题为了将更优质的内容呈现给我们的用户，本问卷仅用于极课向用户调查产品使用满意度，不涉及任何隐私信息收集或泄露！马上填写吧～" textColor:UIColorFromRGB(0x666666) font:mFont(14) textAliment:0];
        _detailLab.numberOfLines = 0;
    }
    return _detailLab;
}


@end
